<%@ page language="java" pageEncoding="utf-8" %>

<!DOCTYPE html>
<html>
<head>
    <%@include file="../common/base.jsp"%>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1"/>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache,must-revalidate">
    <meta http-equiv="expires" content="0">
    <title>输入航班号</title>
    <link rel="stylesheet" type="text/css" href="${base}/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="${base}/css/global.css?version=${version}">
    <link rel="stylesheet" type="text/css" href="${base}/css/login.css?version=${version}">
    <style type="text/css">
        .btn-div .btn-ok {
            display: inline-block;
            width: 100%;
            left: 0px;
            bottom: 0px;
            margin: 0;
            border-radius: 0;
            margin-top: 22px;
            text-align: center;
            color: #fff;
            height: 45px;
            line-height: 45px;
            font-size: 17px;

            border-bottom-left-radius: 10px;
            border-bottom-right-radius: 10px;
        }

        .btn-div .btn-disable {
            background-color: #d0d5d9;
        }

        .btn-div .btn-able {
            background-color: #4f5a67;
        }
        .ip-phone{
            font-family: PingFang-SC;
            font-size: 18px;
            text-align: center;
            color: #4f5a67;
        }
        .container-fluid{
            padding: 0;
            width: 80%;
            min-width: 220px;
        }
        .btn-div .btn-ok{
            border-radius: 5px;
        }
    </style>
</head>
<body style="background-color: #fff;">
<div class="container-fluid">
    <form style="padding: 10px 20px;" class="login-form">
        <p class="ip-phone">请输入航班号</p>
        <ul style="margin-top: 5px;">
            <li class="form-li">
                <input id="telphoneText"
                       maxlength="6"
                       style="width: 100%;text-align: center;border-bottom: 1px solid #9b9b9b;padding: 0;height: auto;"
                       type="text" class="form-controller"
                       placeholder="请输入航班号">
            </li>
        </ul>
    </form>
    <div class="btn-div">
        <a class="btn-ok btn-disable" href="#">确定</a>
    </div>
</div>
</body>
<script type="text/javascript" src="${base}/js/jquery.min.js"></script>
<script type="text/javascript" src="${base}/js/localStorageOpt.js?version=${version}"></script>
<script type="text/javascript" src="${base}/plugin/layer-v3.0.3/layer.js"></script>
<%--<script type="text/javascript" src="${base}/plugin/crypto-js/crypto-js.min.js"></script>--%>
<%--<script type="text/javascript" src="${base}/plugin/jsencrypt/jsencrypt.min.js"></script>--%>
<script type="text/javascript" src="${base}/js/utils.js?version=${version}"></script>
<script type="text/javascript">
    jQuery(document).ready(function ($) {

        var $document = $(document);

        function closeWin() {
            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
            parent.layer.close(index);
//            parent.$('.closeExtraDiv').remove();
        }
        function initpage(){
            var value= parent.$('#changeFlightSpan').data('flightNum') || '';
            $('#telphoneText').val(value||'');
            $('.btn-ok').addClass('btn-able').removeClass('btn-disable');
            if (checkFlight(value)) {
                $('.btn-ok').addClass('btn-able').removeClass('btn-disable');
            } else {
                $('.btn-ok').removeClass('btn-able').addClass('btn-disable');
            }
        }
        initpage();


        $document.on('keyup', '#telphoneText', function (event) {
            var $this = $(this);
            var value = $this.val();
            $('.btn-ok').addClass('btn-able').removeClass('btn-disable');
            if (checkFlight(value)) {
                $('.btn-ok').addClass('btn-able').removeClass('btn-disable');
            } else {
                $('.btn-ok').removeClass('btn-able').addClass('btn-disable');
            }
        });

        $document.on('touchend', '.btn-able', function () {
            // 获取乘车人手机号码，调用后台方法存入session中  "actualMobile"
            var mobile = $("#telphoneText").val();
            if($(this).hasClass('btn-disable')){

            }else{
                setLocalStorage('flightSpan',mobile);
                if(mobile!=''){
                    parent.$('#changeFlightSpan').data('flightNum',mobile);
                    parent.$('#changeFlightSpan').text("航班号：" + mobile);
                }else{
                    parent.$('#changeFlightSpan').data('flightNum',null);
                    parent.$('#changeFlightSpan').text("航班号");
                }
            }
            closeWin();
//            if (!checkPhone(mobile)) {
//                $("#telphoneText").focus().val('');
//                //parent.$('#changeCustomerSpan').text("换乘车人");
//                closeWin();
//                return;
//            }
//            setLocalStorage('actualMobile',mobile);
//            parent.$('#changeCustomerSpan').text("尾号" + mobile.substring(7));
//            closeWin();
        });


    });
</script>
</html>